Skip to content

Conversation

@johuder33
Copy link

@johuder33 johuder33 commented Apr 27, 2017

this PR allow us to connect zimbra LDAP with the user_ldap app, now zimbra users can login with their zimbra accounts to Nextcloud.

@mention-bot
Copy link

@johuder33, thanks for your PR! By analyzing the history of the files in this pull request, we identified @blizzz, @LukasReschke and @leo-b to be potential reviewers.

@blizzz
Copy link
Member

blizzz commented Apr 28, 2017

@johuder33 thanks for your contribution! May I ask you to look into:

  1. Could you sign-off your commit (-s parameter in git commit, more info)

  2. since I have no resources to regularly test against Zimbra, are you OK with being added to @nextcloud/ldap group, in case anything (issue, PR, …) related to Zimbra appears?

  3. Can you add comments in the code how the format for Zimbra members looks like?

  4. What is the context of the change in dynamic groups (new lines 660ff)?

  5. Please keep the new lines at the end of the files

@johuder33
Copy link
Author

@blizzz Ok, I will modify the code and explain it too.

@go2sh
Copy link
Contributor

go2sh commented May 3, 2017

I just had a quick look. Wouldn't it be nice to have a general approach for Group Membership with E-Mails. There are some other ObjectClasses which work the same way only a different attribute. We could make group membership attributes configurable with a switch weather it contains a email address or a user id.

@johuder33
Copy link
Author

@go2sh Thank you for your suggestion, right now I working on this, I hope for the next days I can make your suggestion, it would be nice too. I will considere your comment for the next PR. 👍

@go2sh
Copy link
Contributor

go2sh commented May 4, 2017

If you need some help with it, feel free to ask ;)

@johuder33 johuder33 force-pushed the add-ability-zimbra-ldap branch from dd5fe48 to 5c6a7fc Compare May 4, 2017 16:59
@codecov
Copy link

codecov bot commented May 4, 2017

Codecov Report

Merging #4567 into master will decrease coverage by 0.02%.
The diff coverage is 6.06%.

@@             Coverage Diff              @@
##             master    #4567      +/-   ##
============================================
- Coverage     54.28%   54.26%   -0.03%     
- Complexity    22099    22106       +7     
============================================
  Files          1361     1361              
  Lines         84708    84739      +31     
  Branches       1322     1322              
============================================
- Hits          45983    45980       -3     
- Misses        38725    38759      +34
Impacted Files Coverage Δ Complexity Δ
apps/user_ldap/templates/settings.php 0% <ø> (ø) 0 <0> (ø) ⬇️
apps/user_ldap/lib/Wizard.php 17.13% <0%> (-0.03%) 226 <0> (ø)
apps/user_ldap/lib/Group_LDAP.php 56.75% <6.45%> (-2.98%) 167 <0> (+7)
lib/private/Security/CertificateManager.php 92.78% <0%> (-1.04%) 38% <0%> (ø)
core/js/js.js 61.21% <0%> (-0.57%) 0% <0%> (ø)
lib/private/Server.php 93.51% <0%> (+0.14%) 120% <0%> (ø) ⬇️

…ra accounts

Signed-off-by: Juorder Gonzalez quiñonez <[email protected]>
@johuder33 johuder33 force-pushed the add-ability-zimbra-ldap branch from 5c6a7fc to da20a58 Compare May 4, 2017 17:43
@johuder33
Copy link
Author

@blizzz the changes are done, please add me to the group @nextcloud/ldap, there's not problem with that.

Any doubt you have please let me know.

@ChristophWurst
Copy link
Member

igned-off-by: Juorder Gonzalez quiñonez [email protected]

FYI looks like your git config is not set to your real email address 😉 That's also why GitHub doesn't recognize it's your commit.


if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'zimbramailforwardingaddress') {
// array containing domains
$dns = array();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these days you can use short notation $dns = []; :)

if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'zimbramailforwardingaddress') {
// array containing domains
$dns = array();
// loop througth array members
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

$dns = array();
// loop througth array members
foreach($members as $mailOfMember) {
// split the email of each member eg. [email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intendentation here and the following four lines appears wrong

// array containing domains
$dns = array();
// loop througth array members
foreach($members as $mailOfMember) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this can take a lot of time on big groups with many members. Do you think it is possible to use the provided $uid attribute and attempt to look up the user directly?

);
if ($userMatch !== false) {
// match found so this user is in this group
$pos = strpos($dynamicGroup['dn'][0], ',');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this against groups having a , in their cn?

// we need to extract the group name
// so we extracted from cn=myGroup,ou=people,dc=domain,dc=com
// we extract from position 3 to 7 in the string above, so we have: myGroup
$groups[] = $membershipGroup;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be dealt with $this->access->dn2groupname, because we rely on mappings here and avoid name collisions (e.g. with groups from other backends). Adding the group just like this won't have it mapped and further operations against this group might not work.

$member = $memberParts[0];

// replace all '%uid' with the value of $member and get the filter query
$filter = $this->access->combineFilterWidthAnd(array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in method name, it should be combineFilterWithAnd

@blizzz
Copy link
Member

blizzz commented May 10, 2017

@johuder33 thanks a lot! Please see my review comments, important points are a typo in method name, one worry about group mapping and a question on speeding up one part. I also invited you to the group.

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 10, 2017
@rullzer rullzer added this to the Nextcloud 13 milestone May 23, 2017
@blizzz
Copy link
Member

blizzz commented Nov 13, 2017

@johuder33 any update? i move it 14 due to feature freeze.

@blizzz blizzz modified the milestones: Nextcloud 13, Nextcloud 14 Nov 13, 2017
@MorrisJobke
Copy link
Member

No feedback for 10 months -> closing

😢

@MorrisJobke MorrisJobke closed this Mar 7, 2018
@MorrisJobke MorrisJobke removed this from the Nextcloud 14 milestone Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants